unit CommStatusBar;

{$ALIGN ON}
{$MINENUMSIZE 4}
{$WEAKPACKAGEUNIT}

interface

uses Windows, Messages;

const
  {$EXTERNALSYM ICC_BAR_CLASSES}
  ICC_BAR_CLASSES        = $00000004; // toolbar, statusbar, trackbar, tooltips

const
  {$EXTERNALSYM SBARS_SIZEGRIP}
  SBARS_SIZEGRIP          = $0100;

{$EXTERNALSYM DrawStatusText}
procedure DrawStatusText(hDC: HDC; lprc: PRect; pzsText: PChar;
  uFlags: UINT); stdcall;
{$EXTERNALSYM DrawStatusTextA}
procedure DrawStatusTextA(hDC: HDC; lprc: PRect; pzsText: PAnsiChar;
  uFlags: UINT); stdcall;
{$EXTERNALSYM DrawStatusTextW}
procedure DrawStatusTextW(hDC: HDC; lprc: PRect; pzsText: PWideChar;
  uFlags: UINT); stdcall;
{$EXTERNALSYM CreateStatusWindow}
function CreateStatusWindow(Style: Longint; lpszText: PChar;
  hwndParent: HWND; wID: UINT): HWND; stdcall;
{$EXTERNALSYM CreateStatusWindowA}
function CreateStatusWindowA(Style: Longint; lpszText: PAnsiChar;
  hwndParent: HWND; wID: UINT): HWND; stdcall;
{$EXTERNALSYM CreateStatusWindowW}
function CreateStatusWindowW(Style: Longint; lpszText: PWideChar;
  hwndParent: HWND; wID: UINT): HWND; stdcall;

const
  {$EXTERNALSYM STATUSCLASSNAME}
  STATUSCLASSNAME = 'msctls_statusbar32';

type
  {$EXTERNALSYM tagCOLORSCHEME}
  tagCOLORSCHEME = packed record
    dwSize: DWORD;
    clrBtnHighlight: COLORREF;    // highlight color
    clrBtnShadow: COLORREF;       // shadow color
  end;
  PColorScheme = ^TColorScheme;
  TColorScheme = tagCOLORSCHEME;

const
  {$EXTERNALSYM CCM_FIRST}
  CCM_FIRST               = $2000;      { Common control shared messages }
  {$EXTERNALSYM CCM_SETBKCOLOR}
  CCM_SETBKCOLOR          = CCM_FIRST + 1; // lParam is bkColor

  {$EXTERNALSYM CCM_SETCOLORSCHEME}
  CCM_SETCOLORSCHEME      = CCM_FIRST + 2; // lParam is color scheme
  {$EXTERNALSYM CCM_GETCOLORSCHEME}
  CCM_GETCOLORSCHEME      = CCM_FIRST + 3; // fills in COLORSCHEME pointed to by lParam
  {$EXTERNALSYM CCM_GETDROPTARGET}
  CCM_GETDROPTARGET       = CCM_FIRST + 4;
  {$EXTERNALSYM CCM_SETUNICODEFORMAT}
  CCM_SETUNICODEFORMAT    = CCM_FIRST + 5;
  {$EXTERNALSYM CCM_GETUNICODEFORMAT}
  CCM_GETUNICODEFORMAT    = CCM_FIRST + 6;
  {$EXTERNALSYM SBN_FIRST}
  SBN_FIRST               = 0-880;       { status bar }
  {$EXTERNALSYM SBN_LAST}
  SBN_LAST                = 0-899;



const
  {$EXTERNALSYM SB_SETTEXTA}
  SB_SETTEXTA             = WM_USER+1;
  {$EXTERNALSYM SB_GETTEXTA}
  SB_GETTEXTA             = WM_USER+2;
  {$EXTERNALSYM SB_GETTEXTLENGTHA}
  SB_GETTEXTLENGTHA       = WM_USER+3;
  {$EXTERNALSYM SB_SETTIPTEXTA}
  SB_SETTIPTEXTA          = WM_USER+16;
  {$EXTERNALSYM SB_GETTIPTEXTA}
  SB_GETTIPTEXTA          = WM_USER+18;

  {$EXTERNALSYM SB_SETTEXTW}
  SB_SETTEXTW             = WM_USER+11;
  {$EXTERNALSYM SB_GETTEXTW}
  SB_GETTEXTW             = WM_USER+13;
  {$EXTERNALSYM SB_GETTEXTLENGTHW}
  SB_GETTEXTLENGTHW       = WM_USER+12;
  {$EXTERNALSYM SB_SETTIPTEXTW}
  SB_SETTIPTEXTW          = WM_USER+17;
  {$EXTERNALSYM SB_GETTIPTEXTW}
  SB_GETTIPTEXTW          = WM_USER+19;

  {$EXTERNALSYM SB_SETTEXT}
  SB_SETTEXT             = SB_SETTEXTA;
  {$EXTERNALSYM SB_GETTEXT}
  SB_GETTEXT             = SB_GETTEXTA;
  {$EXTERNALSYM SB_GETTEXTLENGTH}
  SB_GETTEXTLENGTH       = SB_GETTEXTLENGTHA;
  {$EXTERNALSYM SB_SETTIPTEXT}
  SB_SETTIPTEXT          = SB_SETTIPTEXTA;
  {$EXTERNALSYM SB_GETTIPTEXT}
  SB_GETTIPTEXT          = SB_GETTIPTEXTA;

  {$EXTERNALSYM SB_SETPARTS}
  SB_SETPARTS             = WM_USER+4;
  {$EXTERNALSYM SB_GETPARTS}
  SB_GETPARTS             = WM_USER+6;
  {$EXTERNALSYM SB_GETBORDERS}
  SB_GETBORDERS           = WM_USER+7;
  {$EXTERNALSYM SB_SETMINHEIGHT}
  SB_SETMINHEIGHT         = WM_USER+8;
  {$EXTERNALSYM SB_SIMPLE}
  SB_SIMPLE               = WM_USER+9;
  {$EXTERNALSYM SB_GETRECT}
  SB_GETRECT              = WM_USER + 10;
  {$EXTERNALSYM SB_ISSIMPLE}
  SB_ISSIMPLE             = WM_USER+14;
  {$EXTERNALSYM SB_SETICON}
  SB_SETICON              = WM_USER+15;
  {$EXTERNALSYM SB_GETICON}
  SB_GETICON              = WM_USER+20;
  {$EXTERNALSYM SB_SETUNICODEFORMAT}
  SB_SETUNICODEFORMAT     = CCM_SETUNICODEFORMAT;
  {$EXTERNALSYM SB_GETUNICODEFORMAT}
  SB_GETUNICODEFORMAT     = CCM_GETUNICODEFORMAT;

  {$EXTERNALSYM SBT_OWNERDRAW}
  SBT_OWNERDRAW            = $1000;
  {$EXTERNALSYM SBT_NOBORDERS}
  SBT_NOBORDERS            = $0100;
  {$EXTERNALSYM SBT_POPOUT}
  SBT_POPOUT               = $0200;
  {$EXTERNALSYM SBT_RTLREADING}
  SBT_RTLREADING           = $0400;
  {$EXTERNALSYM SBT_TOOLTIPS}
  SBT_TOOLTIPS             = $0800;

  {$EXTERNALSYM SB_SETBKCOLOR}
  SB_SETBKCOLOR            = CCM_SETBKCOLOR;      // lParam = bkColor

  // status bar notifications
  {$EXTERNALSYM SBN_SIMPLEMODECHANGE}
  SBN_SIMPLEMODECHANGE     = SBN_FIRST - 0;


implementation

uses MiniCommCtrl;

procedure DrawStatusText; external cctrl name 'DrawStatusTextA';
procedure DrawStatusTextA; external cctrl name 'DrawStatusTextA';
procedure DrawStatusTextW; external cctrl name 'DrawStatusTextW';
function CreateStatusWindow; external cctrl name 'CreateStatusWindowA';
function CreateStatusWindowA; external cctrl name 'CreateStatusWindowA';
function CreateStatusWindowW; external cctrl name 'CreateStatusWindowW';

end.
